package com.byedu.course;

import org.junit.Before;
import org.junit.Test;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.Tuple;

import java.util.Random;
import java.util.Set;

/**
 * Created by Luo on 2017-10-13.
 */
public class JedisSoredClientSet {

    public static void main(String[] args) throws InterruptedException {
        Jedis jedis = new Jedis("123.57.157.106",6379);
        System.out.println("kais");
        while(true){
            Thread.sleep(3000);
            Set<Tuple> tuples =jedis.zrevrangeWithScores("chuchang:bang", 0, 5);
            System.out.println("----------------------------------");
            for (Tuple tuple : tuples){

                System.out.println(tuple.getElement()+":"+tuple.getScore());
            }
        }
    }

}
